//
//  GuideHomeTableViewCell.m
//  BeautifulShoppings
//
//  Created by GivenBmli on 16/9/13.
//  Copyright © 2016年 GivenBmli. All rights reserved.
//

#import "GuideHomeTableViewCell.h"
#import "GuideHomeModel.h"
#import "UIImageView+WebCache.h"
#import "TAMacro.h"
@implementation GuideHomeTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatSubView];
    }
    return self;
}
- (void)setGuideHomeModel:(GuideHomeModel *)guideHomeModel {
    if (_guideHomeModel != guideHomeModel) {

    }
    [self.cover_image_url sd_setImageWithURL:[NSURL URLWithString:guideHomeModel.cover_image_url] placeholderImage:[UIImage imageNamed:@"站位"]];
    self.title.text = guideHomeModel.title;
    self.id.text = [NSString stringWithFormat:@"%ld",(long)guideHomeModel.Id];
}
- (void)creatSubView {
    self.cover_image_url = [[UIImageView alloc]initWithFrame:CGRectMake(SCREEN_WIDTH / 30, 0, SCREEN_WIDTH - SCREEN_WIDTH/ 15, SCREEN_WIDTH / 2.1)];
    self.cover_image_url.backgroundColor =  [UIColor colorWithRed:(arc4random()%256/255.0) green:(arc4random()%256/255.0) blue:(arc4random()%256/255.0) alpha:1.0];
    [self.contentView addSubview:self.cover_image_url];
    UIView *viewDown = [[UIView alloc]initWithFrame:CGRectMake(SCREEN_WIDTH / 30,SCREEN_WIDTH / 2 -SCREEN_HEIGHT / 15, SCREEN_WIDTH - SCREEN_WIDTH / 15, SCREEN_HEIGHT / 15)];
    viewDown.backgroundColor = [UIColor lightGrayColor];
    viewDown.alpha = 0.3;
    [self.contentView addSubview:viewDown];
    self.title = [[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH / 30, SCREEN_WIDTH / 2 -SCREEN_HEIGHT / 15 , SCREEN_WIDTH - SCREEN_WIDTH / 15, SCREEN_HEIGHT / 15)];
    self.title.textColor = [UIColor whiteColor];
    [self.contentView addSubview:self.title];
}

@end
